$control-treeview: (
  padding: getCssVar(spacing, tight) getCssVar(spacing, base),
  icon-height: getCssVar(spacing, base),
  icon-width: getCssVar(spacing, base),
);

@include b(control-treeview) {
  @include set-component-css-var(control-treeview, $control-treeview);

  height: 100%;
  padding: getCssVar(control-treeview, padding);

}

@include b(control-treeview-node) {
  display: flex;
  flex-grow: 1;
  flex-shrink: 1;
  align-items: center;
  min-width: 1px;
  height: 100%;
  @include e(icon) {
    display: inline-block;
    width: getCssVar(control-treeview, icon-width);
    height: getCssVar(control-treeview, icon-height);
    margin-right: getCssVar(spacing, tight);

    >svg {
      width: 100%;
      height: 100%;
    }
  }

  @include e(label) {
    flex-grow: 1;
    flex-shrink: 1;
    min-width: 1px;
    @include utils-ellipsis;
  }

  &:hover {
    .#{bem(control-treeview-context-menu-trigger)} {
      display: inline-block;
    }
  }

  @include m(disabled){
    color: getCssVar(color, disabled, text);
    cursor: not-allowed;
  }
}

@include b(control-treeview-context-menu-trigger) {
  display: none;
  flex-shrink: 0;
  width: 30px;
  text-align: center;
  cursor: pointer;
  @include e(caption-icon){
    vertical-align: middle;
  }
}

// 树节点上下文菜单样式
@include b(control-treeview-context-menu) {
  &.mx-context-menu {
    padding: getCssVar(spacing, extra-tight) 0;

    .mx-context-menu-item {
      padding: getCssVar(spacing, tight) getCssVar(spacing, base);
    }
  }
}

@include b(control-treeview-quick-search) {
  margin-bottom: getCssVar(spacing, tight);
}
